/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mycompany.action;

import com.opensymphony.xwork2.ActionSupport;
import com.mycompany.entity.Student;
import com.mycompany.dao.StudentDAO;
import java.util.List;
/**
 *
 * @Created on 16-Mar-2009, 16:33:55
 * @author Wenbo.Sun
 */
public class ShowAllStudentsAction extends ActionSupport {
    private static final long serialVersionUID = 1L;

    private List<Student> students;
    private StudentDAO studentDAO;

    public ShowAllStudentsAction(StudentDAO studentDAO) {
        this.studentDAO = studentDAO;
    }

    
    public List<Student> getStudents() {
        return students;
    }

    @Override
    public String execute() throws Exception {
        students = studentDAO.getAll();
        return SUCCESS;
    }


}
